package com.kefu.call.vo;

import java.util.Date;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractUpdateVo;
import com.kefu.call.model.CdrCallhistory;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author CodeGenerator
 * @date 2022/07/26
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "计费_话费扣除历史")
public class CdrCallhistoryUpdateVo extends AbstractUpdateVo<CdrCallhistory,Long> {

    @NotNull
    @ApiModelProperty(value = "主键")
    private String oid;
    
    @ApiModelProperty(value = "线路号")
    private String linenumber;
    
    @ApiModelProperty(value = "被叫号码")
    private String callednumber;
    @ApiModelProperty(value = "创建时间")
    private Date createtime;
    
    @ApiModelProperty(value = "产生的费用")
    private String callcost;
    
    @ApiModelProperty(value = "呼叫分钟")
    private String calltime;
    @ApiModelProperty(value = "是否在套餐内")
    private Boolean issetmeal;
    
    @ApiModelProperty(value = "呼叫id")
    private String callid;
    
    @ApiModelProperty(value = "公司id")
    private String company;
    
    @ApiModelProperty(value = "之前的金额")
    private String beforemoney;
    
    @ApiModelProperty(value = "扣除后余额")
    private String deductmoney;
    
    @ApiModelProperty(value = "扣除钱免费通话时间")
    private String beforetime;
    
    @ApiModelProperty(value = "扣除后免费通话时间")
    private String deducttime;

    @Override
    public CdrCallhistory convert() {
        CdrCallhistory info = new CdrCallhistory();
        info.setLinenumber(linenumber);
        info.setCallednumber(callednumber);
        info.setCreatetime(createtime);
        info.setCallcost(callcost);
        info.setCalltime(calltime);
        info.setIssetmeal(issetmeal);
        info.setCallid(callid);
        info.setCompany(company);
        info.setBeforemoney(beforemoney);
        info.setDeductmoney(deductmoney);
        info.setBeforetime(beforetime);
        info.setDeducttime(deducttime);
        KefuContext context = KefuContext.getKefuContext();
        info.setOid(oid);
        return info;
	}
}